home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / a_utils / cool_pl2.lha / cool-pl2 / tst4.c < prev    next >
C/C++ Source or Header  |  1991-07-25  |  375b  |  18 lines

  1. /* Copyright abandoned 1991 by Lance Norskog. Use as you will. */
  2.  
  3. /* Exception handling test. */
  4.  
  5. #include <setjmp.h>
  6. #include "cool.h"
  7.  
  8. main() {
  9.  
  10.     cool_exception("NastyBad",
  11.     {     /* code */
  12.         cool_raise("NastyBad", "Exceptions don\'t %s!", "work");
  13.     },{    /* handler */
  14.         printf("Exceptions do indeed work.\n");
  15.     })
  16.     cool_raise("ThisIsAnException", "Remove the core file");
  17. }
  18.